<script type="text/javascript" src="tpl_admin/js/jquery.js"></script>
<script type="text/javascript">
function check(){
	var name=$("#admin").val();
	if(name==''){
		alert("用户名不能为空");
		$("#admin").focus();
		return false;

	}
	
	var patt=new RegExp();
	patt=/\W/;
	if(patt.test(name)){
		alert("用户名只能包含数字字母和下划线！");
		$("#admin").focus();
		return false;
	}
	
	var pwd=$("#pwd").val();
	if(pwd==''){
		alert("密码不能为空");
		$("#pwd").focus();
		return false;
	}
}
</script>

<{if $error != ''}>
	<{foreach from=$error item=er}>
	错误：<{$er}>
	<{/foreach}>
<{/if}>
<form action="admin.php?do=log_in" method="post" OnSubmit="return check()" >
	用户名：<input type="text" id="admin" name="admin" />
	密码：<input type="password" id="pwd" name="pwd" />
	<input type="submit" value="登陆"/>

</form>